package org.zjx.app.task;

import lombok.Getter;
import org.zjx.command.entity.Sects;

import java.util.Arrays;
import java.util.List;

@Getter
public enum ProfessionType {
    PHYSICAL("物理系", "高物理伤害门派", Arrays.asList(
            Sects.DA_TANG_GUAN_FU,  // 大唐官府
            Sects.SHI_TUO_LING,    // 狮驼岭
            Sects.MO_WANG_ZHAI,       // 力五庄
            Sects.HUA_GUO_SHAN,       // 花果山
            Sects.TIAN_GONG         // 天宫
    )),
    MAGICAL("法术系", "高法术伤害门派", Arrays.asList(
            Sects.LONG_GONG,        // 龙宫
            Sects.MO_WANG_ZHAI,     // 魔王寨
            Sects.HUA_GUO_SHAN       // 花果山
    )),
    HEALER("治疗系", "治疗辅助门派", Arrays.asList(
            Sects.PU_TUO_SHAN,      // 普陀山
            Sects.HUA_SHENG_SI,       // 化生寺
            Sects.WU_ZHUANG_GUAN    // 五庄观
    )),
    REVIVE("治疗系", "治疗辅助门派", Arrays.asList(
            Sects.PU_TUO_SHAN,      // 普陀山
            Sects.HUA_SHENG_SI       // 化生寺
    )),

    CONTROL("控制系", "封印控制门派", Arrays.asList(
            Sects.FANG_CUN_SHAN,     // 方寸山
            Sects.TIAN_GONG         // 天宫
    )),
    HYBRID("混合系", "多面手门派", Arrays.asList(
            Sects.YIN_CAO_DI_FU,       // 阴曹地府
            Sects.WU_ZHUANG_GUAN    // 五庄观
    ));

    private final String name;
    private final String description;
    private final List<Sects> relatedSects;

    ProfessionType(String name, String description, List<Sects> relatedSects) {
        this.name = name;
        this.description = description;
        this.relatedSects = relatedSects;
    }

    public static boolean isPhysical(Sects sects) {
        return PHYSICAL.relatedSects.contains(sects);
    }

    public static boolean isMajor(Sects sects) {
        return MAGICAL.relatedSects.contains(sects);
    }

    public static boolean isHealer(Sects sects) {
        return HEALER.relatedSects.contains(sects);
    }

    public static boolean isRevive(Sects sects) {
        return REVIVE.relatedSects.contains(sects);
    }

    public static boolean isControl(Sects sects) {
        return CONTROL.relatedSects.contains(sects);
    }

    public static boolean isHybrid(Sects sects) {
        return HYBRID.relatedSects.contains(sects);
    }



    /**
     * 获取门派推荐加点方案
     */
    public String getRecommendation() {
        switch (this) {
            case PHYSICAL:
                return "4力1耐或5力";
            case MAGICAL:
                return "4魔1耐或5魔";
            case HEALER:
                return "2体2耐1敏或3体2耐";
            case CONTROL:
                return "2体2耐1敏或1体2耐2敏";
            default:
                return "根据定位灵活加点";
        }
    }
}